import { MockMethod } from 'vite-plugin-mock'
import { SUCCESS_CODE } from '@/constants'

const timeout = 1000

export default [
  {
    url: '/api/equipmentType/list',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: {
          totalCount: 100,
          totalPage: 1,
          pageSize: 10,
          list: [
            {
              equipmentTypeId: 1,
              equipmentTypeName: '篮球',
              createUser: 'jasonfu',
              updateUser: 'jasonfu',
              createTime: '2025-01-28 14:27:32',
              updateTime: '2025-01-28 14:27:32'
            },
            {
              equipmentTypeId: 2,
              equipmentTypeName: '足球',
              createUser: 'jasonfu',
              updateUser: 'jasonfu',
              createTime: '2025-01-28 14:27:32',
              updateTime: '2025-01-28 14:27:32'
            },
            {
              equipmentTypeId: 3,
              equipmentTypeName: '排球',
              createUser: 'jasonfu',
              updateUser: 'jasonfu',
              createTime: '2025-01-28 14:27:32',
              updateTime: '2025-01-28 14:27:32'
            }
          ]
        }
      }
    }
  },
  {
    url: '/api/equipmentType/listAll',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data:[
          {
            equipmentTypeId: 1,
            equipmentTypeName: '篮球',
            createUser: 'jasonfu',
            updateUser: 'jasonfu',
            createTime: '2025-01-28 14:27:32',
            updateTime: '2025-01-28 14:27:32'
          },
          {
            equipmentTypeId: 2,
            equipmentTypeName: '足球',
            createUser: 'jasonfu',
            updateUser: 'jasonfu',
            createTime: '2025-01-28 14:27:32',
            updateTime: '2025-01-28 14:27:32'
          },
          {
            equipmentTypeId: 3,
            equipmentTypeName: '排球',
            createUser: 'jasonfu',
            updateUser: 'jasonfu',
            createTime: '2025-01-28 14:27:32',
            updateTime: '2025-01-28 14:27:32'
          }
        ]
      }
    }
  },
  // 新增设备类型
  {
    url: '/api/equipmentType/insert',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: null
      }
    }
  },
  // 更新设备类型
  {
    url: '/api/equipmentType/update',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: null
      }
    }
  },
  // 器材列表
  {
    url: '/api/equipment/list',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: {
          totalCount: 100,
          totalPage: 1,
          pageSize: 10,
          list: [
            {
              equipmentId: 1,
              equipmentTypeId: 1,
              name: '斯伯丁篮球（大号）',
              brand: '斯伯丁',
              model: '大号',
              price: 500.00,
              stockQuantity: 200,
              createTime: '2025-01-29 12:28:14',
              updateTime: '2025-01-29 12:35:48'
            }
          ]
        }
      }
    }
  },
  // 新增器材
  {
    url: '/api/equipment/insert',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: null
      }
    }
  },
  // 更新器材
  {
    url: '/api/equipment/update',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: null
      }
    }
  },
  // 删除器材
  {
    url: '/api/equipment/delete',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: null
      }
    }
  }
] as MockMethod[]
